package com.yadang.redisson.client;

import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author: 亚当
 * @date: 2023年02月12日 12:02
 * @package: com.yadang.redisson.client
 * @Description: TODO
 */
public class RedissonClient {

    private Redisson redisson;

    public RedissonClient() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://localhost:6379").setPassword("password");
        redisson = (Redisson) Redisson.create(config);
    }

    public Redisson getRedisson() {
        return redisson;
    }

    public void close() {
        redisson.shutdown();
    }
}

